// source --> https://croatianvintage.com.au/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart.min.js?ver=6.5.1 jQuery(function(d){if("undefined"==typeof wc_add_to_cart_params)return!1;var t=function(){this.requests=[],this.addRequest=this.addRequest.bind(this),this.run=this.run.bind(this),d(document.body).on("click",".add_to_cart_button",{addToCartHandler:this},this.onAddToCart).on("click",".remove_from_cart_button",{addToCartHandler:this},this.onRemoveFromCart).on("added_to_cart",this.updateButton).on("ajax_request_not_sent.adding_to_cart",this.updateButton).on("added_to_cart removed_from_cart",{addToCartHandler:this},this.updateFragments)};t.prototype.addRequest=function(t){this.requests.push(t),1===this.requests.length&&this.run()},t.prototype.run=function(){var t=this,a=t.requests[0].complete;t.requests[0].complete=function(){"function"==typeof a&&a(),t.requests.shift(),0'+wc_add_to_cart_params.i18n_view_cart+""),d(document.body).trigger("wc_cart_button_updated",[r]))},t.prototype.updateFragments=function(t,a){a&&(d.each(a,function(t){d(t).addClass("updating").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}})}),d.each(a,function(t,a){d(t).replaceWith(a),d(t).stop(!0).css("opacity","1").unblock()}),d(document.body).trigger("wc_fragments_loaded"))},new t}); // source --> https://croatianvintage.com.au/wp-content/plugins/wp-image-makers-easy-hotspot-solution//assets/js/front.js?ver=1.0.0 jQuery(function ($) { 'use strict'; if ($('.wpim').length) { $('.wpim').on('click', '.wpim-marker--click .wpim-marker__icon', function (e) { var $marker = $(this).closest('.wpim-marker'); var $parent = $marker.closest('.wpim'); if ($marker.hasClass('focus')) { return; } $parent.find('.focus').removeClass('focus'); $marker.addClass('focus'); e.preventDefault(); }); $('.wpim').on('mouseover', '.wpim-marker--hover .wpim-marker__icon', function (e) { var $marker = $(this).closest('.wpim-marker'); var $parent = $marker.closest('.wpim'); if ($marker.hasClass('focus')) { return; } $parent.find('.focus').removeClass('focus'); $marker.addClass('focus'); e.preventDefault(); }); $('.wpim').on('click', '.wpim-infowindow__close', function (e) { var $this = $(this); $this.closest('.wpim-marker').removeClass('focus'); $this.closest('.wpim-infowindow--hover').hide(); setTimeout(function () { $this.closest('.wpim-infowindow--hover').removeAttr('style'); }, 200); e.preventDefault(); }); var showMarker = function (i) { setTimeout(function () { $('.wpim-marker').eq(i).addClass('show bounceIn'); }, (i * 300)); } $('.wpim-marker').each(function (index) { showMarker(index); }); } }); // source --> https://croatianvintage.com.au/wp-content/plugins/js_composer/assets/js/vendors/woocommerce-add-to-cart.js?ver=6.2.0 (function ( $ ) { 'use strict'; $( document ).ready( function () { $( 'body' ).on( 'adding_to_cart', function ( event, $button, data ) { if ( $button && $button.hasClass( 'vc_gitem-link' ) ) { $button .addClass( 'vc-gitem-add-to-cart-loading-btn' ) .parents( '.vc_grid-item-mini' ) .addClass( 'vc-woocommerce-add-to-cart-loading' ) .append( $( '
' ) ); } } ).on( 'added_to_cart', function ( event, fragments, cart_hash, $button ) { if ( 'undefined' === typeof ($button) ) { $button = $( '.vc-gitem-add-to-cart-loading-btn' ); } if ( $button && $button.hasClass( 'vc_gitem-link' ) ) { $button .removeClass( 'vc-gitem-add-to-cart-loading-btn' ) .parents( '.vc_grid-item-mini' ) .removeClass( 'vc-woocommerce-add-to-cart-loading' ) .find( '.vc_wc-load-add-to-loader-wrapper' ).remove(); } } ); } ); })( window.jQuery ); // source --> https://croatianvintage.com.au/wp-content/plugins/shopkeeper-extender/includes/custom-menu/assets/js/custom-menu.js?ver=5.9.9 jQuery(function($) { "use strict"; const getMousePos = (e) => { let posx = 0; let posy = 0; if (!e) e = window.event; if (e.pageX || e.pageY) { posx = e.pageX; posy = e.pageY; } else if (e.clientX || e.clientY) { posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; } return { x : posx, y : posy } } class HoverImage { constructor(el) { this.DOM = {el: el}; this.DOM.reveal = document.createElement('div'); this.DOM.reveal.className = 'hover-reveal'; this.DOM.reveal.innerHTML = `
`; this.DOM.el.appendChild(this.DOM.reveal); this.DOM.revealInner = this.DOM.reveal.querySelector('.hover-reveal__inner'); this.DOM.revealInner.style.overflow = 'hidden'; this.DOM.revealImg = this.DOM.revealInner.querySelector('.hover-reveal__img'); this.initEvents(); } initEvents() { this.positionElement = (ev) => { const mousePos = getMousePos(ev); const docScrolls = { left : document.body.scrollLeft + document.documentElement.scrollLeft, top : document.body.scrollTop + document.documentElement.scrollTop }; this.DOM.reveal.style.top = `${mousePos.y-20-docScrolls.top}px`; this.DOM.reveal.style.left = `${mousePos.x+20-docScrolls.left}px`; }; this.mouseenterFn = (ev) => { this.positionElement(ev); var elem = this; setTimeout( function() { elem.showImage(); }, 300); }; this.mousemoveFn = ev => requestAnimationFrame(() => { this.positionElement(ev); }); this.mouseleaveFn = () => { this.hideImage(); }; this.DOM.el.addEventListener('mouseenter', this.mouseenterFn); this.DOM.el.addEventListener('mousemove', this.mousemoveFn); this.DOM.el.addEventListener('mouseleave', this.mouseleaveFn); } showImage() { TweenMax.killTweensOf(this.DOM.revealInner); TweenMax.killTweensOf(this.DOM.revealImg); this.tl = new TimelineMax({ onStart: () => { this.DOM.reveal.style.opacity = 1; // TweenMax.set(this.DOM.el, {zIndex: 9999}); } }) .add('begin') .add(new TweenMax(this.DOM.revealInner, 0.3, { ease: Sine.easeOut, startAt: {x: '-100%'}, x: '0%' }), 'begin') .add(new TweenMax(this.DOM.revealImg, 0.3, { ease: Sine.easeOut, startAt: {x: '100%'}, x: '0%' }), 'begin'); var el = this.DOM.reveal setTimeout( function() { el.classList.add('showed'); },200); } hideImage() { this.DOM.reveal.classList.remove('showed'); TweenMax.killTweensOf(this.DOM.revealInner); TweenMax.killTweensOf(this.DOM.revealImg); this.tl = new TimelineMax({ onStart: () => { // TweenMax.set(this.DOM.el, {zIndex: 9999}); }, onComplete: () => { // TweenMax.set(this.DOM.el, {zIndex: ''}); TweenMax.set(this.DOM.reveal, {opacity: 0}); } }) .add('begin') .add(new TweenMax(this.DOM.revealInner, 0.3, { ease: Sine.easeOut, x: '100%' }), 'begin') .add(new TweenMax(this.DOM.revealImg, 0.3, { ease: Sine.easeOut, x: '-100%' }), 'begin'); } } $('.menu-item a.has-hover-img').on({ mouseenter: function() { new HoverImage($(this)[0]); }, mouseleave: function() { if($(this).find('.hover-reveal')){ var el = $(this); setTimeout( function() { el.find('.hover-reveal').remove(); },350); } } }); });